<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <!-- ⼆进制转⼗进制，⼗进制转⼆进制，各编写⼀个函数。输入二进制数字调用函数转成十进制，输入十进制数字调用函数转成二进制。 -->
</head>
<body>
  <script>
    function decimalNum(num){
      console.log(num.toString(2));
    }
    decimalNum(1111011)
    
    function sel(str){
    console.log(parseInt(str, 2));
    }
    sel(1111011)
  </script>
</body>
</html>